<?php
	class WorkingMemory {
		public $Store = array();
		
		public function decrement($main_key, $key, $amount) {
			$this -> increment($main_key, $key, $amount * -1);
		}
		
		public function increment($main_key, $key, $amount) {
			$total = $this -> recall($main_key, $key) + $amount;
			$this -> store($main_key, $key, $total);
		}
		
		public function recall($main_key, $key) {
			if (!isset($this -> Store[$main_key][$key])) {
				$this -> Store[$main_key][$key] = 0;
			}
			
			return $this -> Store[$main_key][$key];
		}
		
		public function store($main_key, $key, $value) {
			$this -> Store[$main_key][$key] = $value;
		}
	}
?>